local yinzhan_delay = fk.CreateSkill{
  name = "investiture__yinzhan_delay",
}

Fk:loadTranslationTable{ ["investiture__yinzhan_delay"] = "饮盏" }

yinzhan_delay:addEffect(fk.Damage, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player == target and player:getMark("@investiture__yinzhan-turn") > 0
  end,
  on_cost = function (self, event, target, player, data)
    event:setCostData(self, player:getMark("@investiture__yinzhan-turn"))
    player.room:setPlayerMark(player, "@investiture__yinzhan-turn", 0)
    return true
  end,
  on_use = function (self, event, target, player, data)
    local n = event:getCostData(self)
    local room = player.room
    table.forEach(room:getAlivePlayers(), function (p)
      if p:hasSkill("investiture__yinzhan", true) then
        room:doIndicate(player, {p})
        p:drawCards(n, "investiture__yinzhan")
      end
    end)
  end
})

return yinzhan_delay